/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package net.sigawe.gateway.dao.impl;

import java.sql.Connection;
import java.sql.PreparedStatement;
import net.sigawe.gateway.dao.interfc.IInboxDAO;
import net.sigawe.gateway.model.Inbox;
import java.sql.SQLException;

/**
 *
 * @author ServerGawe
 */
public class InboxDAO implements IInboxDAO {

    private Connection connection = null;

    public InboxDAO(Connection connection) {
        this.connection = connection;
    }

    public void insert(Inbox inbox) throws SQLException {
        String sql = "INSERT INTO inbox VALUES(null,?,?)";
        PreparedStatement statement = this.connection.prepareStatement(sql);
        statement.setString(1, inbox.getSender());
        statement.setString(2, inbox.getText());
        statement.executeUpdate();
        statement.close();

    }
}
